package com.team24.hotel.utils;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

public class OrderIdGenerator {
    public static String getOneOrderId(){
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyyMMddHHmmss");
        String date=simpleDateFormat.format(new Date());
        Random random=new Random();
        String result="";
        for (int i = 0; i < 3; i++) {
            result+=random.nextInt(10);
        }
        result=date+result;
        return result;
    }

    public static String getRefundId(){
        SimpleDateFormat simpleDateFormat=new SimpleDateFormat("yyyyMMddHHmmss");
        String date=simpleDateFormat.format(new Date());
        Random random=new Random();
        String result="";
        for (int i = 0; i < 2; i++) {
            result+=random.nextInt(10);
        }
        result=date+result+"t";
        return result;
    }
}
